package ooday01;

public class Car {
    //成员变量   描述对象属性
    String brand;
    String color;
    double price;
    int capacity;

    //无参构造方法
    Car(){

    }
    //有参构造方法
    Car(String brand, String color,  double price, int capacity){
        this.brand = brand;       //this.brand = 奥迪;     this.brand = 保时捷;
        this.color = color;       //this.color = 白色;     this.color = 蓝色;
        this.price = price;       //this.price = 600000;   this.price = 100000;
        this.capacity = capacity; //this.capacity = 5;     this.capacity = 2;
    }

    //方法   描述对象行为
    void start(){
        System.out.println(brand+"牌子的"+color+"色的"+price+"价格的"+capacity+"座的车启动了");
    }
    void run(){
        System.out.println(brand+"牌子的"+color+"色的"+price+"价格的"+capacity+"座的车跑起来了");
    }
    void stop(){
        System.out.println(brand+"牌子的"+color+"色的"+price+"价格的"+capacity+"座的车停车了");
    }

}
